import sys

if len(sys.argv) > 1:
    filename = sys.argv[1]
    file = open (filename)
    data = file.read()
    file.close()

    result = "CompilationHost=\""
    if "0 failed" in data:
        result = result + str(data.count(": warning"))    
    else:
        result = result + str(-1)
            
    result = result + "\""
    print result
else:
    print "Usage:"
    print "> convertor_vs2010 <filename>"
    print
    print "Example:"
    print "> convertor_vs2010 my_compilation_output.txt"





